<template>
  <view class="me-container">
    <view class="status_bar"><!-- 这里是状态栏 --></view>

    <!-- 遮罩层 -->
    <view
      :class="['mask', storeListShow ? 'mask-show' : 'mask-hide']"
      @touchstart="clickMask()"
    ></view>

    <!-- 头部分 -->
    <view class="header-section">
      <!-- 企业/店铺信息 -->
      <view class="store-box">
        <view class="store-info flex flex-ac-c" @click="storeListDown()">
          <i-icon icon="iconshouye-zhankai_2" color="#000"></i-icon>
          <view class="info-box">
            <view class="store-name">
              <text class="text">{{ store.storeName?store.storeName:store.companyName }}</text>
              <view class="icon-box" @click.stop="goMargin">
                <i-icon
                  icon="iconbao_1"
                  :color="store.isPay ? '#eb5c02' : '#898989'"
                ></i-icon>
              </view>
            </view>
            <!-- <view class="com-name">{{ store.companyName }}</view> -->
          </view>
        </view>

        <view :class="['store-list', storeListShow ? 'store-list-down' : '']">
          <view class="list">
            <block v-for="(item, i) in list" :key="i">
              <view class="item flex flex-ac-c" @click="EnterCompany(item,i)">
                <view class="info-box">
                  <view class="store-name">
                    <text class="text">{{ item.storename?item.storename:item.companyname }}</text>
                    <i-icon
                      icon="iconbao_1"
                      :color="item.isPay ? '#eb5c02' : '#898989'"
                    ></i-icon>
                  </view>
                  <!-- <view class="com-name">{{ item.companyName }}</view> -->
                </view>
              </view>
            </block>
          </view>

          <view class="btn">
            <!-- 跳转到企业认证页面 -->
            <!-- /pages_login/register/register -->
            <u-button
              type="primary"
              shape="circle"
              size="default"
              class="btn-bgcolor"
              hover-class="btn-bgcolor-hover"
              @click="goPage('/pages_login/register/register?type=add')"
            >
              <i-icon icon="icontianjia" size="32rpx"></i-icon>
              <text class="btn-text">创建企业</text>
            </u-button>
          </view>
        </view>
      </view>

      <!-- 用户信息 -->
      <view class="user-info flex flex-ac-c" @click="goUserInfo()">
        <view class="head-port">
          <image :src="user.headImg" mode="widthFix"></image>
        </view>
        <view class="info-box">
          <view class="user">
            <text class="name">{{ user.userName }}</text>
            <text class="gread">{{ user.roleName }}</text>
          </view>
          <view class="com-name">{{ user.jobName }}</view>
        </view>
      </view>
    </view>

    <!-- 主要内容 -->
    <view class="main">
      <view class="tool flex flex-jc-sa">
        <view class="li" @click="goCollection">
          <i-icon icon="iconshoucang" type="mutiple" size="80rpx"></i-icon>
          <view class="text">收藏</view>
        </view>
        <view
          v-if="auth !== 'Factory'"
          class="li"
          @click="goPage('/pages_order/carGoodsOrder/buyCar/buyCar')"
        >
          <i-icon icon="icongouwuche2" type="mutiple" size="80rpx"></i-icon>
          <view class="text">购物车</view>
        </view>
        <view class="li" @click="goFen">
          <i-icon icon="iconfensi" type="mutiple" size="80rpx"></i-icon>
          <view class="text">粉丝</view>
        </view>
      </view>

      <!-- 我的订单 -->
      <link-card
        title="我的订单"
        :data="contentLinks.orderLinks"
        class="link-card"
      ></link-card>

      <!-- 商品/业务管理 -->
      <link-card
        title="商品/业务管理"
        :data="contentLinks.goodsLinks"
        class="link-card"
        :auth="auth === 'RepairStore' ? auth : ''"
      ></link-card>

      <!-- 推广服务 -->
      <template v-if="auth !== 'BeautyStore'">
        <link-card
          title="推广服务"
          :data="contentLinks.promotionServerLinks"
          class="link-card"
        ></link-card>
      </template>

      <!-- 新手开店任务 -->
      <!-- 暂时隐藏 -->
      <view v-if="false" class="create-store-box">
        <view class="title">新手开店任务</view>
        <view class="step-box">
          <view class="row flex">
            <view class="is-checked bf-none">
              <view class="icon-y"></view>
            </view>
            <view class="content flex flex-ai-c flex-jc-sb">
              <text>信息完善</text>
              <view class="btn">未完成</view>
            </view>
          </view>
          <view class="row flex">
            <view class="is-checked">
              <view class="icon-y"></view>
            </view>
            <view class="content flex flex-ai-c flex-jc-sb">
              <text>上架商品</text>
              <view class="btn">
                <navigator
                  url="/pages_carGoods/selectTheCategory/selectTheCategory"
                  >未完成</navigator
                >
              </view>
            </view>
          </view>
          <view class="row flex">
            <view class="is-checked af-none">
              <view class="" v-if="store.isPay">
                <i-icon
                  icon="iconxuanzhong"
                  class="middle"
                  type="single"
                  size="24rpx"
                  color="#FBD220"
                ></i-icon>
              </view>
              <view v-else class="icon-y"></view>
            </view>
            <view class="content flex flex-ai-c flex-jc-sb">
              <text>开店保证金</text>
              <view class="btn"
                ><navigator url="/pages_common/pages_me/margin/margin">{{
                  store.isPay ? '完成' : '未完成'
                }}</navigator>
              </view>
            </view>
          </view>
        </view>
      </view>

      <view class="total-list">
        <!-- 没有交保证金，则显示立即开通这块 -->
        <view v-if="!store.isPay" class="title-back flex flex-jc-sb">
          <view class="left">店铺/商品对外展示</view>
          <view
            class="right"
            @click="goPage('/pages_common/pages_me/margin/margin')"
          >
            <text>立即开通</text>
            <u-icon name="arrow-right" color="#FFE23E" size="20"></u-icon>
          </view>
        </view>

        <!-- 功能选项列表 -->
        <view class="ul" :class="!store.isPay ? 'is-ts' : ''">
          <view v-for="item in modulesList" :key="item.label">
            <view
              class="li flex flex-ac-c flex-jc-sb"
              @click="goPage(item.path)"
            >
              <view class="label">
                <i-icon
                  :icon="item.icon"
                  class="icon"
                  :color="item.color"
                ></i-icon>
                <text class="name">{{ item.label }}</text>
              </view>
              <view class="icon-right"
                ><u-icon name="arrow-right" color="#9A9A9A" size="20"></u-icon
              ></view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>
<script src="./me.js"></script>

<style lang="scss" scoped>
@import './me.scss';
</style>
